package dao

import (
	"database/sql"
	"encoding/json"
	_ "github.com/go-sql-driver/mysql"
	"log"
)

/*数据库启动*/

type DatabaseCfg struct {
	host     string
	prot     string
	user     string
	passwd   string
	database string
}

func Test() string {

	log.Println("tttttt")
	db, err := sql.Open("mysql", "root:123456@tcp(127.0.0.1:3307)/wp")

	rows, err := db.Query("select * from wp_action")
	if err != nil {
		log.Println(err)
	} else {
		log.Println(rows)
	}
	b, err := json.Marshal(rows)
	if err != nil {
		log.Println(err)
	}
	return string(b)
}
